﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Krist_em_up.Characters;
using Microsoft.Xna.Framework;

namespace Krist_em_up.Item.Weapons
{
    public abstract class Weapon
    {
        protected TimeSpan reloadTimer;

        protected int ammunition;

        public int Ammunition
        {
            get { return ammunition; }
            protected set
            {
                if (value < 0)
                    throw new NoAmmoException();
                else
                    ammunition = value;
            }
        }

        /// <summary>
        /// Name of the weapon
        /// </summary>
        public string Name
        {
            get { return name; }
            protected set { name = value; }
        }

        protected string name;

        protected int owner;

        protected Kristemup game;

        /// <summary>
        /// Pull the trigger nigga!
        /// </summary>
        /// <param name="position">Position where the weapon shoot</param>
        /// <param name="direction">True for right, false for left</param>
        public abstract void Shoot(Vector2 position, bool direction);

        public virtual void Update(GameTime gameTime)
        {
            reloadTimer -= gameTime.ElapsedGameTime;
        }
    }
}
